package com.survey.bean;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.survey.util.FD;

import tk.mybatis.mapper.annotation.NameStyle;
import tk.mybatis.mapper.code.Style;

@Entity
@Table(name = "t_quesitemlist")
@NameStyle(Style.normal)
public class QuesItemList {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	private Integer		id;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "itemId")
	@FD("项目分类")
	private QuesItem	item;
	@Column(updatable = false)
	private Integer		itemId;
	@FD("题目")
	@Column(length = 500)
	private String		question;
	@FD("题型")
	private String		typesel;	//单选,多选,填空

	private String		gs;
	private Integer		zi;

	@Transient
	private Object		userchose;
	@Transient
	private List			list;
	@Transient
	private String		anlnames;
	@Transient
	private String		anlvalues;

	@Transient
	public int getMaxlength() {
		if (zi == null)
			return 500;
		return zi;
	}

	@Transient
	public String getCheck() {
		if (gs == null)
			return "";
		return gs;
	}

	public String getGs() {
		return gs;
	}

	public void setGs(String gs) {
		this.gs = gs;
	}

	public Integer getZi() {
		return zi;
	}

	public void setZi(Integer zi) {
		this.zi = zi;
	}

	public String getAnlnames() {
		return anlnames;
	}

	public void setAnlnames(String anlnames) {
		this.anlnames = anlnames;
	}

	public String getAnlvalues() {
		return anlvalues;
	}

	public void setAnlvalues(String anlvalues) {
		this.anlvalues = anlvalues;
	}

	public Object getUserchose() {
		return userchose;
	}

	public void setUserchose(Object userchose) {
		this.userchose = userchose;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public QuesItem getItem() {
		return item;
	}

	public void setItem(QuesItem item) {
		this.item = item;
	}

	public Integer getItemId() {
		return itemId;
	}

	public void setItemId(Integer itemId) {
		this.itemId = itemId;
	}

	public String getQuestion() {
		return question;
	}

	public void setQuestion(String question) {
		this.question = question;
	}

	public String getTypesel() {
		return typesel;
	}

	public void setTypesel(String typesel) {
		this.typesel = typesel;
	}

}
